<script setup lang="ts"></script>

<template>
  <div class="thinking">
    <div class="thinking-loading">
      <div></div>
      <div></div>
      <div></div>
    </div>
    <div class="thinking-content"></div>
  </div>
</template>

<style scoped>
.thinking {
  display: flex;
  align-items: center;
  width: 100%;
  height: 20px;
  margin: 10px;
}

.thinking-content {
  display: flex;
  justify-content: center;
  width: fit-content;
  color: var(--chat-primary-color);
  padding-left: 10px;
}

.thinking-content::after {
  content: '';
  animation: loading 1.4s infinite;
}

@keyframes loading {
  0% {
    content: '思考中.';
  }
  33% {
    content: '思考中..';
  }
  66% {
    content: '思考中...';
  }
  100% {
    content: '思考中.';
  }
}

.thinking-loading,
.thinking-loading > div {
  position: relative;
  box-sizing: border-box;
}

.thinking-loading {
  display: block;
  font-size: 0;
  color: var(--chat-primary-color-hover);
}

.thinking-loading > div:first-child {
  color: var(--chat-primary-color);
}

.thinking-loading > div {
  display: inline-block;
  float: none;
  background-color: currentColor;
  border: 0 solid currentColor;
}

.thinking-loading {
  width: 30px;
  height: 30px;
}

.thinking-loading > div {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 100%;
  opacity: 0;
  animation: ball-scale-multiple 0.8s 0s linear infinite;
}

.thinking-loading > div:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-loading > div:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ball-scale-multiple {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  5% {
    opacity: 0.75;
  }

  100% {
    opacity: 0;
    transform: scale(1);
  }
}
</style>
